﻿using System;

namespace 埃式筛
{
    class Program
    {
        static void Main(string[] args)
        {
            bool [] a=new bool[105];
            for (int i = 1; i <= 100; i++)
                a[i] = true;
            for (int i = 2; i <= 50; i++)
            {
                for (int j = 2; j <= i * i&&i*j<=100; j++)
                {
                    a[i * j] = false;
                }
            }
            string s = "";
            for(int i=2;i<=100;i++)
                if(a[i]==true)
                {
                    s += Convert.ToString(i);
                    s += ",";
                }
            Console.WriteLine("100以内的质数有：" + s);
        }
    }
}
